import request from '@/request/request'

export default {
  // 获取iscsi用户组列表
  getUserGroupListRequest() {
    return request('get', 'block/iscsi_group/')
  },

  // 新增用户组
  addUserGroupRequest(data) {
    return request('put', 'block/iscsi_group/', data)
  },

  // 编辑用户组
  editUserGroupRequest(data) {
    return request('post', '/block/iscsi_group/update', data)
  },

  // 删除用户组
  delUserGroupRequest(data) {
    return request('DELETE', 'block/iscsi_group/', data)
  },

  // 获取target和块设备名(lun)
  getTargetRequest() {
    // return request('post', 'block/iscsi/getRbdBlocksAndTargets')
    return request('post', 'block/iscsi_group/getGroupBlockTarget')
  },

  // 通过target获取客户端
  getClientLunByTargetRequest(data) {
    return request('post', 'block/iscsi_group/getIscsiGroupBlockIqn', data)
  },

  // 通过target获取用户组
  getUserGroupByTargetRequest(data) {
    return request('post', 'block/iscsi/getIscsiGroup', data)
  },

  // 获取拓扑图
  getTopologyByTarget(data) {
    return request('post', 'block/target/icsiTopology', data)
  },

  // 获取访问路径页面表格数据
  getTargetListRequest() {
    return request('get', 'block/target')
  },

  // 获取网关信息
  getGatewayInfoRequest() {
    return request('post', 'block/target/gatewayInfo')
  },

  // 新增访问路径(target)
  addTargetRequest(data) {
    return request('post', 'block/target/createTarger', data)
  },

  // 编辑访问路径(target)
  editTargetRequest(data) {
    return request('post', 'block/target/updateTarget', data)
  },

  // 删除访问路径(target)
  deleteTargetRequest(data) {
    return request('DELETE', 'block/target', data)
  },

}